<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cppMISC: tcpSvr类 参考</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript" src="../../darkmode_toggle.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cppMISC<span id="projectnumber">&#160;v1.1</span>
   </div>
   <div id="projectbrief">cppMisc 文档系统</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-types">Public 类型</a> &#124;
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="../../da/d9a/classtcp_svr-members.html">所有成员列表</a>  </div>
  <div class="headertitle"><div class="title">tcpSvr类 参考</div></div>
</div><!--header-->
<div class="contents">

<p>使用LIBUV实现的TCP服务器模块  
 <a href="#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="../../df/ddf/tcp_svr_8hpp_source.html">tcpSvr.hpp</a>&gt;</code></p>
<div class="dynheader">
类 tcpSvr 继承关系图:</div>
<div class="dyncontent">
<div class="center"><img src="../../d5/dac/classtcp_svr__inherit__graph.png" border="0" usemap="#atcp_svr_inherit__map" alt="Inheritance graph"/></div>
<map name="atcp_svr_inherit__map" id="atcp_svr_inherit__map">
<area shape="rect" title="使用LIBUV实现的TCP服务器模块" alt="" coords="29,448,205,1269"/>
<area shape="rect" href="../../de/d17/structdc_itfc.html" title="数据通道接口，用来统一数据操作接口。 其中涉及到错误编号的时候，当错误编号小于0的时候是错误编号，等于0的时候是没有发生错误" alt="" coords="5,5,229,400"/>
<area shape="poly" title=" " alt="" coords="120,415,120,448,115,448,115,415"/>
</map>
</div>
<div class="dynheader">
tcpSvr 的协作图:</div>
<div class="dyncontent">
<div class="center"><img src="../../da/dae/classtcp_svr__coll__graph.png" border="0" usemap="#atcp_svr_coll__map" alt="Collaboration graph"/></div>
<map name="atcp_svr_coll__map" id="atcp_svr_coll__map">
<area shape="rect" title="使用LIBUV实现的TCP服务器模块" alt="" coords="29,448,205,1269"/>
<area shape="rect" href="../../de/d17/structdc_itfc.html" title="数据通道接口，用来统一数据操作接口。 其中涉及到错误编号的时候，当错误编号小于0的时候是错误编号，等于0的时候是没有发生错误" alt="" coords="5,5,229,400"/>
<area shape="poly" title=" " alt="" coords="120,415,120,448,115,448,115,415"/>
</map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-types" name="pub-types"></a>
Public 类型</h2></td></tr>
<tr class="memitem:a36b3958f1a4acbd7be1c0126160d5db6" id="r_a36b3958f1a4acbd7be1c0126160d5db6"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a36b3958f1a4acbd7be1c0126160d5db6">emErrCode</a> { <a class="el" href="#a36b3958f1a4acbd7be1c0126160d5db6aa63bce0a43eb55a8340508cbe295a3a5">ERR_ALLOC_MEM</a> = -1000
, <a class="el" href="#a36b3958f1a4acbd7be1c0126160d5db6a3f26a076df1905cc8ff903fee6385d01">ERR_INIT</a>
, <a class="el" href="#a36b3958f1a4acbd7be1c0126160d5db6ae5c21a09e002d724b2286c5f930f90b5">ERR_LISTEN</a>
, <a class="el" href="#a36b3958f1a4acbd7be1c0126160d5db6a352c2aa603754295e5cb923b81857d83">OK</a> = 0
 }</td></tr>
<tr class="separator:a36b3958f1a4acbd7be1c0126160d5db6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:ac11f12960c2655654da062d206a0fe01" id="r_ac11f12960c2655654da062d206a0fe01"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ac11f12960c2655654da062d206a0fe01">tcpSvr</a> ()</td></tr>
<tr class="separator:ac11f12960c2655654da062d206a0fe01"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a52c5b8580fc4c8d07fd9ce2a2940230a" id="r_a52c5b8580fc4c8d07fd9ce2a2940230a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a52c5b8580fc4c8d07fd9ce2a2940230a">tcpSvr</a> (const std::string &amp;ip, int port)</td></tr>
<tr class="separator:a52c5b8580fc4c8d07fd9ce2a2940230a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5276b4330fb248b0b2312edd323e3baa" id="r_a5276b4330fb248b0b2312edd323e3baa"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a5276b4330fb248b0b2312edd323e3baa">~tcpSvr</a> ()</td></tr>
<tr class="separator:a5276b4330fb248b0b2312edd323e3baa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4add02ff33836fd7682ebde58f1a606a" id="r_a4add02ff33836fd7682ebde58f1a606a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a4add02ff33836fd7682ebde58f1a606a">onUpdateTbl</a> (std::function&lt; void(const std::string &amp;data) &gt; fun)</td></tr>
<tr class="memdesc:a4add02ff33836fd7682ebde58f1a606a"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置数据更新处理的回调函数。主要用来更新表格和文件  <br /></td></tr>
<tr class="separator:a4add02ff33836fd7682ebde58f1a606a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0f76b1e77ef99c4b0d8aa35e4bec2aba" id="r_a0f76b1e77ef99c4b0d8aa35e4bec2aba"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a0f76b1e77ef99c4b0d8aa35e4bec2aba">connect</a> (const std::string &amp;url, bool bind=false) final</td></tr>
<tr class="separator:a0f76b1e77ef99c4b0d8aa35e4bec2aba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a37a59a25e5b004011b96c96aacb9cce9" id="r_a37a59a25e5b004011b96c96aacb9cce9"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a37a59a25e5b004011b96c96aacb9cce9">send</a> (const char *data, size_t len) final</td></tr>
<tr class="separator:a37a59a25e5b004011b96c96aacb9cce9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab29c078f0fe5b2a6d7f7723e535c9bcd" id="r_ab29c078f0fe5b2a6d7f7723e535c9bcd"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab29c078f0fe5b2a6d7f7723e535c9bcd">close</a> () final</td></tr>
<tr class="separator:ab29c078f0fe5b2a6d7f7723e535c9bcd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a764f972608217fda804f163f8161bba1" id="r_a764f972608217fda804f163f8161bba1"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a764f972608217fda804f163f8161bba1">onRecv</a> (const char *data, size_t len) final</td></tr>
<tr class="separator:a764f972608217fda804f163f8161bba1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aadbc4fb737284bf3ea64166fc188867f" id="r_aadbc4fb737284bf3ea64166fc188867f"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aadbc4fb737284bf3ea64166fc188867f">onError</a> (int err) final</td></tr>
<tr class="separator:aadbc4fb737284bf3ea64166fc188867f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a31000bcdb772f0e6e5379673b441a0ed" id="r_a31000bcdb772f0e6e5379673b441a0ed"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a31000bcdb772f0e6e5379673b441a0ed">onConnected</a> () final</td></tr>
<tr class="separator:a31000bcdb772f0e6e5379673b441a0ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a902f2d204f63a7c56cf8ddcad8891e47" id="r_a902f2d204f63a7c56cf8ddcad8891e47"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a902f2d204f63a7c56cf8ddcad8891e47">onDisconnected</a> () final</td></tr>
<tr class="separator:a902f2d204f63a7c56cf8ddcad8891e47"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0c8b8d9b62b578170ff55f620455ad7a" id="r_a0c8b8d9b62b578170ff55f620455ad7a"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a0c8b8d9b62b578170ff55f620455ad7a">onClose</a> () final</td></tr>
<tr class="separator:a0c8b8d9b62b578170ff55f620455ad7a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af62c43e6a3a16e353d42f50028668ce4" id="r_af62c43e6a3a16e353d42f50028668ce4"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#af62c43e6a3a16e353d42f50028668ce4">onSend</a> (int err) final</td></tr>
<tr class="separator:af62c43e6a3a16e353d42f50028668ce4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1c3315642ee239fa39e4bd6f5bd9afd0" id="r_a1c3315642ee239fa39e4bd6f5bd9afd0"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1c3315642ee239fa39e4bd6f5bd9afd0">onClientConnected</a> () final</td></tr>
<tr class="separator:a1c3315642ee239fa39e4bd6f5bd9afd0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a52861dbf4db48f2dfc7a88c31d18aef8" id="r_a52861dbf4db48f2dfc7a88c31d18aef8"><td class="memItemLeft" align="right" valign="top">virtual const std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a52861dbf4db48f2dfc7a88c31d18aef8">type</a> () const</td></tr>
<tr class="separator:a52861dbf4db48f2dfc7a88c31d18aef8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a59f4dfec6bfc99048cc71072210d526c" id="r_a59f4dfec6bfc99048cc71072210d526c"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a59f4dfec6bfc99048cc71072210d526c">evtError</a> (std::function&lt; void(int err) &gt; fun) final</td></tr>
<tr class="separator:a59f4dfec6bfc99048cc71072210d526c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2e68bfd470bb9db9b758a575f5aad5b7" id="r_a2e68bfd470bb9db9b758a575f5aad5b7"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a2e68bfd470bb9db9b758a575f5aad5b7">evtConnected</a> (std::function&lt; void() &gt; fun) final</td></tr>
<tr class="separator:a2e68bfd470bb9db9b758a575f5aad5b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a23ac4cb70bee9eae64582ddde4630331" id="r_a23ac4cb70bee9eae64582ddde4630331"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a23ac4cb70bee9eae64582ddde4630331">evtClientConnected</a> (std::function&lt; void(const std::string &amp;) &gt; fun) final</td></tr>
<tr class="memdesc:a23ac4cb70bee9eae64582ddde4630331"><td class="mdescLeft">&#160;</td><td class="mdescRight">对于服务器有效  <br /></td></tr>
<tr class="separator:a23ac4cb70bee9eae64582ddde4630331"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af49ec64c530988f230b9df265b1041c4" id="r_af49ec64c530988f230b9df265b1041c4"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#af49ec64c530988f230b9df265b1041c4">evtClientDisconnected</a> (std::function&lt; void(const std::string &amp;) &gt; fun) final</td></tr>
<tr class="separator:af49ec64c530988f230b9df265b1041c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac36b5e29b718f1deb99ad69e4c1803d1" id="r_ac36b5e29b718f1deb99ad69e4c1803d1"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ac36b5e29b718f1deb99ad69e4c1803d1">evtClosed</a> (std::function&lt; void() &gt; fun) final</td></tr>
<tr class="separator:ac36b5e29b718f1deb99ad69e4c1803d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad5e4c03d0b81738911580933263c82c7" id="r_ad5e4c03d0b81738911580933263c82c7"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad5e4c03d0b81738911580933263c82c7">evtRecv</a> (std::function&lt; void(const char *data, size_t len)&gt; fun) final</td></tr>
<tr class="separator:ad5e4c03d0b81738911580933263c82c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abb75cef0d726b5d402a4349a07194296" id="r_abb75cef0d726b5d402a4349a07194296"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#abb75cef0d726b5d402a4349a07194296">evtSend</a> (std::function&lt; void(int err) &gt; fun) final</td></tr>
<tr class="separator:abb75cef0d726b5d402a4349a07194296"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8f2269332703e9cc735e9e5d4a71705b" id="r_a8f2269332703e9cc735e9e5d4a71705b"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a8f2269332703e9cc735e9e5d4a71705b">evtStop</a> (std::function&lt; void()&gt; fun) final</td></tr>
<tr class="memdesc:a8f2269332703e9cc735e9e5d4a71705b"><td class="mdescLeft">&#160;</td><td class="mdescRight">对于服务器有效.用于关闭监听  <br /></td></tr>
<tr class="separator:a8f2269332703e9cc735e9e5d4a71705b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab02384e56ed993d541cd8515677b59ac" id="r_ab02384e56ed993d541cd8515677b59ac"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab02384e56ed993d541cd8515677b59ac">incomingConnection</a> (int status)</td></tr>
<tr class="separator:ab02384e56ed993d541cd8515677b59ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0a91e51bf5771438dc49b1b32a2618c0" id="r_a0a91e51bf5771438dc49b1b32a2618c0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a0a91e51bf5771438dc49b1b32a2618c0">onRecvData</a> (const std::string &amp;name, const char *data, size_t len)</td></tr>
<tr class="memdesc:a0a91e51bf5771438dc49b1b32a2618c0"><td class="mdescLeft">&#160;</td><td class="mdescRight">处理接收到数据，对数据进行解析，呈现等操作  <br /></td></tr>
<tr class="separator:a0a91e51bf5771438dc49b1b32a2618c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8aef970122df3d741a030713456c82d" id="r_aa8aef970122df3d741a030713456c82d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa8aef970122df3d741a030713456c82d">onDisconnected</a> (const std::string &amp;name)</td></tr>
<tr class="memdesc:aa8aef970122df3d741a030713456c82d"><td class="mdescLeft">&#160;</td><td class="mdescRight">处理客户端断开操作  <br /></td></tr>
<tr class="separator:aa8aef970122df3d741a030713456c82d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aafa854488ad50ba9761a3bb129764637" id="r_aafa854488ad50ba9761a3bb129764637"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aafa854488ad50ba9761a3bb129764637">onClientError</a> (const std::string &amp;name, <a class="el" href="../../d5/dca/classtcp_connect.html#a4d03abd4b5fcdddd1824fa62d7e1d76a">tcpConnect::emErrCode</a> code, const std::string &amp;msg)</td></tr>
<tr class="memdesc:aafa854488ad50ba9761a3bb129764637"><td class="mdescLeft">&#160;</td><td class="mdescRight">处理客户端错误  <br /></td></tr>
<tr class="separator:aafa854488ad50ba9761a3bb129764637"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_structdc_itfc"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_structdc_itfc')"><img src="../../closed.png" alt="-"/>&#160;Public 成员函数 继承自 <a class="el" href="../../de/d17/structdc_itfc.html">dcItfc</a></td></tr>
<tr class="memitem:ac5dc97bfbd7470174d41fa37a59e3a2b inherit pub_methods_structdc_itfc" id="r_ac5dc97bfbd7470174d41fa37a59e3a2b"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d17/structdc_itfc.html#ac5dc97bfbd7470174d41fa37a59e3a2b">evtClientDisconnected</a> (std::function&lt; void(const std::string &amp;)&gt; fun)=0</td></tr>
<tr class="separator:ac5dc97bfbd7470174d41fa37a59e3a2b inherit pub_methods_structdc_itfc"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>使用LIBUV实现的TCP服务器模块 </p>
<dl class="section version"><dt>版本</dt><dd>1.0 </dd></dl>
<dl class="section date"><dt>日期</dt><dd>2020-9-22 </dd></dl>
<dl class="section author"><dt>作者</dt><dd>宋炜 </dd></dl>

<p class="definition">在文件 <a class="el" href="../../df/ddf/tcp_svr_8hpp_source.html">tcpSvr.hpp</a> 第 <a class="el" href="../../df/ddf/tcp_svr_8hpp_source.html#l00023">23</a> 行定义.</p>
</div><h2 class="groupheader">成员枚举类型说明</h2>
<a id="a36b3958f1a4acbd7be1c0126160d5db6" name="a36b3958f1a4acbd7be1c0126160d5db6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a36b3958f1a4acbd7be1c0126160d5db6">&#9670;&#160;</a></span>emErrCode</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="#a36b3958f1a4acbd7be1c0126160d5db6">tcpSvr::emErrCode</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">枚举值</th></tr><tr><td class="fieldname"><a id="a36b3958f1a4acbd7be1c0126160d5db6aa63bce0a43eb55a8340508cbe295a3a5" name="a36b3958f1a4acbd7be1c0126160d5db6aa63bce0a43eb55a8340508cbe295a3a5"></a>ERR_ALLOC_MEM&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a36b3958f1a4acbd7be1c0126160d5db6a3f26a076df1905cc8ff903fee6385d01" name="a36b3958f1a4acbd7be1c0126160d5db6a3f26a076df1905cc8ff903fee6385d01"></a>ERR_INIT&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a36b3958f1a4acbd7be1c0126160d5db6ae5c21a09e002d724b2286c5f930f90b5" name="a36b3958f1a4acbd7be1c0126160d5db6ae5c21a09e002d724b2286c5f930f90b5"></a>ERR_LISTEN&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a36b3958f1a4acbd7be1c0126160d5db6a352c2aa603754295e5cb923b81857d83" name="a36b3958f1a4acbd7be1c0126160d5db6a352c2aa603754295e5cb923b81857d83"></a>OK&#160;</td><td class="fielddoc"></td></tr>
</table>

<p class="definition">在文件 <a class="el" href="../../df/ddf/tcp_svr_8hpp_source.html">tcpSvr.hpp</a> 第 <a class="el" href="../../df/ddf/tcp_svr_8hpp_source.html#l00026">26</a> 行定义.</p>

</div>
</div>
<h2 class="groupheader">构造及析构函数说明</h2>
<a id="ac11f12960c2655654da062d206a0fe01" name="ac11f12960c2655654da062d206a0fe01"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac11f12960c2655654da062d206a0fe01">&#9670;&#160;</a></span>tcpSvr() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">tcpSvr::tcpSvr </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00019">19</a> 行定义.</p>

</div>
</div>
<a id="a52c5b8580fc4c8d07fd9ce2a2940230a" name="a52c5b8580fc4c8d07fd9ce2a2940230a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a52c5b8580fc4c8d07fd9ce2a2940230a">&#9670;&#160;</a></span>tcpSvr() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">tcpSvr::tcpSvr </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;</td>          <td class="paramname"><span class="paramname"><em>ip</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int</td>          <td class="paramname"><span class="paramname"><em>port</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00021">21</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="../../d2/d50/classtcp_svr_a52c5b8580fc4c8d07fd9ce2a2940230a_cgraph.png" border="0" usemap="#ad2/d50/classtcp_svr_a52c5b8580fc4c8d07fd9ce2a2940230a_cgraph" alt=""/></div>
<map name="ad2/d50/classtcp_svr_a52c5b8580fc4c8d07fd9ce2a2940230a_cgraph" id="ad2/d50/classtcp_svr_a52c5b8580fc4c8d07fd9ce2a2940230a_cgraph">
<area shape="rect" title=" " alt="" coords="5,13,111,40"/>
<area shape="rect" href="../../de/d44/classwheels_1_1dm_1_1singleton.html#ab064e1d47abf923e4ae0deaac875c173" title=" " alt="" coords="159,5,307,48"/>
<area shape="poly" title=" " alt="" coords="111,24,143,24,143,29,111,29"/>
</map>
</div>

</div>
</div>
<a id="a5276b4330fb248b0b2312edd323e3baa" name="a5276b4330fb248b0b2312edd323e3baa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5276b4330fb248b0b2312edd323e3baa">&#9670;&#160;</a></span>~tcpSvr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">tcpSvr::~tcpSvr </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00037">37</a> 行定义.</p>

</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a id="ab29c078f0fe5b2a6d7f7723e535c9bcd" name="ab29c078f0fe5b2a6d7f7723e535c9bcd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab29c078f0fe5b2a6d7f7723e535c9bcd">&#9670;&#160;</a></span>close()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::close </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>实现了 <a class="el" href="../../de/d17/structdc_itfc.html#aba834607fa0a5348502faa54c05b6793">dcItfc</a>.</p>

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00207">207</a> 行定义.</p>

</div>
</div>
<a id="a0f76b1e77ef99c4b0d8aa35e4bec2aba" name="a0f76b1e77ef99c4b0d8aa35e4bec2aba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0f76b1e77ef99c4b0d8aa35e4bec2aba">&#9670;&#160;</a></span>connect()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::connect </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;</td>          <td class="paramname"><span class="paramname"><em>url</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>bind</em></span><span class="paramdefsep"> = </span><span class="paramdefval">false</span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>实现了 <a class="el" href="../../de/d17/structdc_itfc.html#a683be737dda8743a4c57330173659558">dcItfc</a>.</p>

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00183">183</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="../../d2/d50/classtcp_svr_a0f76b1e77ef99c4b0d8aa35e4bec2aba_cgraph.png" border="0" usemap="#ad2/d50/classtcp_svr_a0f76b1e77ef99c4b0d8aa35e4bec2aba_cgraph" alt=""/></div>
<map name="ad2/d50/classtcp_svr_a0f76b1e77ef99c4b0d8aa35e4bec2aba_cgraph" id="ad2/d50/classtcp_svr_a0f76b1e77ef99c4b0d8aa35e4bec2aba_cgraph">
<area shape="rect" title=" " alt="" coords="5,123,119,149"/>
<area shape="rect" href="../../dc/d4c/tcp_svr_8cpp.html#aad3cf4543921afb4bc5d2068be6b8c85" title=" " alt="" coords="167,123,303,149"/>
<area shape="poly" title=" " alt="" coords="119,133,151,133,151,139,119,139"/>
<area shape="rect" href="../../d2/d50/classtcp_svr.html#ab02384e56ed993d541cd8515677b59ac" title=" " alt="" coords="351,123,536,149"/>
<area shape="poly" title=" " alt="" coords="303,133,336,133,336,139,303,139"/>
<area shape="rect" href="../../d5/dca/classtcp_connect.html#aacaae6d523ad0440eb5d30c8ff07b3e8" title="读取错误消息" alt="" coords="611,5,748,32"/>
<area shape="poly" title=" " alt="" coords="460,120,513,81,583,42,600,35,602,40,585,46,516,86,464,124"/>
<area shape="rect" href="../../de/d44/classwheels_1_1dm_1_1singleton.html#ab064e1d47abf923e4ae0deaac875c173" title=" " alt="" coords="605,56,754,99"/>
<area shape="poly" title=" " alt="" coords="500,120,590,97,591,102,501,125"/>
<area shape="rect" href="../../d5/dca/classtcp_connect.html#ac906dea41da72e91452818a0bd8383aa" title=" " alt="" coords="584,123,775,149"/>
<area shape="poly" title=" " alt="" coords="537,133,569,133,569,139,537,139"/>
<area shape="rect" href="../../d5/dca/classtcp_connect.html#a07bd0d4dc7717401320314fa817996c2" title=" " alt="" coords="610,173,749,200"/>
<area shape="poly" title=" " alt="" coords="510,147,600,167,599,172,509,153"/>
<area shape="rect" href="../../d5/dca/classtcp_connect.html#a773c8544725f30fdc63afaf934f6aefd" title="设置事件回调函数" alt="" coords="609,224,750,251"/>
<area shape="poly" title=" " alt="" coords="468,147,520,178,585,210,605,217,603,222,583,214,518,183,465,152"/>
</map>
</div>

</div>
</div>
<a id="a23ac4cb70bee9eae64582ddde4630331" name="a23ac4cb70bee9eae64582ddde4630331"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a23ac4cb70bee9eae64582ddde4630331">&#9670;&#160;</a></span>evtClientConnected()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::evtClientConnected </td>
          <td>(</td>
          <td class="paramtype">std::function&lt; void(const std::string &amp;) &gt;</td>          <td class="paramname"><span class="paramname"><em>fun</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>对于服务器有效 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">fun</td><td></td></tr>
  </table>
  </dd>
</dl>

<p>实现了 <a class="el" href="../../de/d17/structdc_itfc.html#ae4bc76c247fe82d026bd886b8922266f">dcItfc</a>.</p>

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00270">270</a> 行定义.</p>

</div>
</div>
<a id="af49ec64c530988f230b9df265b1041c4" name="af49ec64c530988f230b9df265b1041c4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af49ec64c530988f230b9df265b1041c4">&#9670;&#160;</a></span>evtClientDisconnected()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::evtClientDisconnected </td>
          <td>(</td>
          <td class="paramtype">std::function&lt; void(const std::string &amp;) &gt;</td>          <td class="paramname"><span class="paramname"><em>fun</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00256">256</a> 行定义.</p>

</div>
</div>
<a id="ac36b5e29b718f1deb99ad69e4c1803d1" name="ac36b5e29b718f1deb99ad69e4c1803d1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac36b5e29b718f1deb99ad69e4c1803d1">&#9670;&#160;</a></span>evtClosed()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::evtClosed </td>
          <td>(</td>
          <td class="paramtype">std::function&lt; void() &gt;</td>          <td class="paramname"><span class="paramname"><em>fun</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>实现了 <a class="el" href="../../de/d17/structdc_itfc.html#aeb25eb4177e4fcf5f71c43557117eed5">dcItfc</a>.</p>

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00275">275</a> 行定义.</p>

</div>
</div>
<a id="a2e68bfd470bb9db9b758a575f5aad5b7" name="a2e68bfd470bb9db9b758a575f5aad5b7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2e68bfd470bb9db9b758a575f5aad5b7">&#9670;&#160;</a></span>evtConnected()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::evtConnected </td>
          <td>(</td>
          <td class="paramtype">std::function&lt; void() &gt;</td>          <td class="paramname"><span class="paramname"><em>fun</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>实现了 <a class="el" href="../../de/d17/structdc_itfc.html#afcca8985af3ad66c3cb2dabd265ab66a">dcItfc</a>.</p>

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00265">265</a> 行定义.</p>

</div>
</div>
<a id="a59f4dfec6bfc99048cc71072210d526c" name="a59f4dfec6bfc99048cc71072210d526c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a59f4dfec6bfc99048cc71072210d526c">&#9670;&#160;</a></span>evtError()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::evtError </td>
          <td>(</td>
          <td class="paramtype">std::function&lt; void(int err) &gt;</td>          <td class="paramname"><span class="paramname"><em>fun</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>实现了 <a class="el" href="../../de/d17/structdc_itfc.html#a6a7cb3bcd4319482321107ffb06fef95">dcItfc</a>.</p>

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00261">261</a> 行定义.</p>

</div>
</div>
<a id="ad5e4c03d0b81738911580933263c82c7" name="ad5e4c03d0b81738911580933263c82c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad5e4c03d0b81738911580933263c82c7">&#9670;&#160;</a></span>evtRecv()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::evtRecv </td>
          <td>(</td>
          <td class="paramtype">std::function&lt; void(const char *data, size_t len)&gt;</td>          <td class="paramname"><span class="paramname"><em>fun</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>实现了 <a class="el" href="../../de/d17/structdc_itfc.html#a3e26237ed9abb93d34ed1f12f3a81e21">dcItfc</a>.</p>

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00279">279</a> 行定义.</p>

</div>
</div>
<a id="abb75cef0d726b5d402a4349a07194296" name="abb75cef0d726b5d402a4349a07194296"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abb75cef0d726b5d402a4349a07194296">&#9670;&#160;</a></span>evtSend()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::evtSend </td>
          <td>(</td>
          <td class="paramtype">std::function&lt; void(int err) &gt;</td>          <td class="paramname"><span class="paramname"><em>fun</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>实现了 <a class="el" href="../../de/d17/structdc_itfc.html#a79dd374eaaa258ffa03cbb306d3a3de3">dcItfc</a>.</p>

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00283">283</a> 行定义.</p>

</div>
</div>
<a id="a8f2269332703e9cc735e9e5d4a71705b" name="a8f2269332703e9cc735e9e5d4a71705b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8f2269332703e9cc735e9e5d4a71705b">&#9670;&#160;</a></span>evtStop()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::evtStop </td>
          <td>(</td>
          <td class="paramtype">std::function&lt; void()&gt;</td>          <td class="paramname"><span class="paramname"><em>fun</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>对于服务器有效.用于关闭监听 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">fun</td><td></td></tr>
  </table>
  </dd>
</dl>

<p>实现了 <a class="el" href="../../de/d17/structdc_itfc.html#ac0d494c310963f45d061fd7bc52b5bd7">dcItfc</a>.</p>

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00288">288</a> 行定义.</p>

</div>
</div>
<a id="ab02384e56ed993d541cd8515677b59ac" name="ab02384e56ed993d541cd8515677b59ac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab02384e56ed993d541cd8515677b59ac">&#9670;&#160;</a></span>incomingConnection()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::incomingConnection </td>
          <td>(</td>
          <td class="paramtype">int</td>          <td class="paramname"><span class="paramname"><em>status</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00073">73</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="../../d2/d50/classtcp_svr_ab02384e56ed993d541cd8515677b59ac_cgraph.png" border="0" usemap="#ad2/d50/classtcp_svr_ab02384e56ed993d541cd8515677b59ac_cgraph" alt=""/></div>
<map name="ad2/d50/classtcp_svr_ab02384e56ed993d541cd8515677b59ac_cgraph" id="ad2/d50/classtcp_svr_ab02384e56ed993d541cd8515677b59ac_cgraph">
<area shape="rect" title=" " alt="" coords="5,123,191,149"/>
<area shape="rect" href="../../d5/dca/classtcp_connect.html#aacaae6d523ad0440eb5d30c8ff07b3e8" title="读取错误消息" alt="" coords="266,5,402,32"/>
<area shape="poly" title=" " alt="" coords="115,120,168,81,238,42,254,35,256,40,240,46,171,86,118,124"/>
<area shape="rect" href="../../de/d44/classwheels_1_1dm_1_1singleton.html#ab064e1d47abf923e4ae0deaac875c173" title=" " alt="" coords="260,56,408,99"/>
<area shape="poly" title=" " alt="" coords="154,120,244,97,245,102,155,125"/>
<area shape="rect" href="../../d5/dca/classtcp_connect.html#ac906dea41da72e91452818a0bd8383aa" title=" " alt="" coords="239,123,429,149"/>
<area shape="poly" title=" " alt="" coords="191,133,223,133,223,139,191,139"/>
<area shape="rect" href="../../d5/dca/classtcp_connect.html#a07bd0d4dc7717401320314fa817996c2" title=" " alt="" coords="265,173,403,200"/>
<area shape="poly" title=" " alt="" coords="164,147,254,167,253,172,163,153"/>
<area shape="rect" href="../../d5/dca/classtcp_connect.html#a773c8544725f30fdc63afaf934f6aefd" title="设置事件回调函数" alt="" coords="263,224,404,251"/>
<area shape="poly" title=" " alt="" coords="122,147,175,178,240,210,259,217,257,222,238,214,172,183,119,152"/>
</map>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="../../d2/d50/classtcp_svr_ab02384e56ed993d541cd8515677b59ac_icgraph.png" border="0" usemap="#ad2/d50/classtcp_svr_ab02384e56ed993d541cd8515677b59ac_icgraph" alt=""/></div>
<map name="ad2/d50/classtcp_svr_ab02384e56ed993d541cd8515677b59ac_icgraph" id="ad2/d50/classtcp_svr_ab02384e56ed993d541cd8515677b59ac_icgraph">
<area shape="rect" title=" " alt="" coords="351,5,536,32"/>
<area shape="rect" href="../../dc/d4c/tcp_svr_8cpp.html#aad3cf4543921afb4bc5d2068be6b8c85" title=" " alt="" coords="167,5,303,32"/>
<area shape="poly" title=" " alt="" coords="336,21,303,21,303,16,336,16"/>
<area shape="rect" href="../../d2/d50/classtcp_svr.html#a0f76b1e77ef99c4b0d8aa35e4bec2aba" title=" " alt="" coords="5,5,119,32"/>
<area shape="poly" title=" " alt="" coords="151,21,119,21,119,16,151,16"/>
</map>
</div>

</div>
</div>
<a id="a1c3315642ee239fa39e4bd6f5bd9afd0" name="a1c3315642ee239fa39e4bd6f5bd9afd0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1c3315642ee239fa39e4bd6f5bd9afd0">&#9670;&#160;</a></span>onClientConnected()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::onClientConnected </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>实现了 <a class="el" href="../../de/d17/structdc_itfc.html#a5a455d55880e929db216b77768df9932">dcItfc</a>.</p>

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00254">254</a> 行定义.</p>

</div>
</div>
<a id="aafa854488ad50ba9761a3bb129764637" name="aafa854488ad50ba9761a3bb129764637"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aafa854488ad50ba9761a3bb129764637">&#9670;&#160;</a></span>onClientError()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::onClientError </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;</td>          <td class="paramname"><span class="paramname"><em>name</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d5/dca/classtcp_connect.html#a4d03abd4b5fcdddd1824fa62d7e1d76a">tcpConnect::emErrCode</a></td>          <td class="paramname"><span class="paramname"><em>code</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;</td>          <td class="paramname"><span class="paramname"><em>msg</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>处理客户端错误 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">name[</td><td>I ] 远程名称 </td></tr>
    <tr><td class="paramname">code[</td><td>I ] 错误编号 </td></tr>
    <tr><td class="paramname">msg[</td><td>I ] 错误信息 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00165">165</a> 行定义.</p>

</div>
</div>
<a id="a0c8b8d9b62b578170ff55f620455ad7a" name="a0c8b8d9b62b578170ff55f620455ad7a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0c8b8d9b62b578170ff55f620455ad7a">&#9670;&#160;</a></span>onClose()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::onClose </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>实现了 <a class="el" href="../../de/d17/structdc_itfc.html#aa4284e7336cd979c61bfc79a72ca90a7">dcItfc</a>.</p>

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00242">242</a> 行定义.</p>

</div>
</div>
<a id="a31000bcdb772f0e6e5379673b441a0ed" name="a31000bcdb772f0e6e5379673b441a0ed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a31000bcdb772f0e6e5379673b441a0ed">&#9670;&#160;</a></span>onConnected()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::onConnected </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>实现了 <a class="el" href="../../de/d17/structdc_itfc.html#acb102933438410297cb1ce2bdb61bf47">dcItfc</a>.</p>

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00230">230</a> 行定义.</p>

</div>
</div>
<a id="a902f2d204f63a7c56cf8ddcad8891e47" name="a902f2d204f63a7c56cf8ddcad8891e47"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a902f2d204f63a7c56cf8ddcad8891e47">&#9670;&#160;</a></span>onDisconnected() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::onDisconnected </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>实现了 <a class="el" href="../../de/d17/structdc_itfc.html#aedb94ecc6c33b46519041a183100d315">dcItfc</a>.</p>

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00236">236</a> 行定义.</p>

</div>
</div>
<a id="aa8aef970122df3d741a030713456c82d" name="aa8aef970122df3d741a030713456c82d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa8aef970122df3d741a030713456c82d">&#9670;&#160;</a></span>onDisconnected() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::onDisconnected </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;</td>          <td class="paramname"><span class="paramname"><em>name</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>处理客户端断开操作 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">name[</td><td>I ], 远程名称 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00144">144</a> 行定义.</p>

</div>
</div>
<a id="aadbc4fb737284bf3ea64166fc188867f" name="aadbc4fb737284bf3ea64166fc188867f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aadbc4fb737284bf3ea64166fc188867f">&#9670;&#160;</a></span>onError()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::onError </td>
          <td>(</td>
          <td class="paramtype">int</td>          <td class="paramname"><span class="paramname"><em>err</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>实现了 <a class="el" href="../../de/d17/structdc_itfc.html#a7fecbd0b883d5c80551b15eb4786229e">dcItfc</a>.</p>

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00224">224</a> 行定义.</p>

</div>
</div>
<a id="a764f972608217fda804f163f8161bba1" name="a764f972608217fda804f163f8161bba1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a764f972608217fda804f163f8161bba1">&#9670;&#160;</a></span>onRecv()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::onRecv </td>
          <td>(</td>
          <td class="paramtype">const char *</td>          <td class="paramname"><span class="paramname"><em>data</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t</td>          <td class="paramname"><span class="paramname"><em>len</em></span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>实现了 <a class="el" href="../../de/d17/structdc_itfc.html#adf293d37a6b5306a9b1cc95efb5703b6">dcItfc</a>.</p>

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00217">217</a> 行定义.</p>

</div>
</div>
<a id="a0a91e51bf5771438dc49b1b32a2618c0" name="a0a91e51bf5771438dc49b1b32a2618c0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0a91e51bf5771438dc49b1b32a2618c0">&#9670;&#160;</a></span>onRecvData()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::onRecvData </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;</td>          <td class="paramname"><span class="paramname"><em>name</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *</td>          <td class="paramname"><span class="paramname"><em>data</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t</td>          <td class="paramname"><span class="paramname"><em>len</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>处理接收到数据，对数据进行解析，呈现等操作 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">name[</td><td>I ], 远程名称，实际是ip:port的方式 </td></tr>
    <tr><td class="paramname">data[</td><td>I ], 接收到的数据 </td></tr>
    <tr><td class="paramname">len[</td><td>I ], 数据长度 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00139">139</a> 行定义.</p>

</div>
</div>
<a id="af62c43e6a3a16e353d42f50028668ce4" name="af62c43e6a3a16e353d42f50028668ce4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af62c43e6a3a16e353d42f50028668ce4">&#9670;&#160;</a></span>onSend()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::onSend </td>
          <td>(</td>
          <td class="paramtype">int</td>          <td class="paramname"><span class="paramname"><em>err</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>实现了 <a class="el" href="../../de/d17/structdc_itfc.html#ac931cf0d15bb515c7abd0b89a2cb9caa">dcItfc</a>.</p>

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00248">248</a> 行定义.</p>

</div>
</div>
<a id="a4add02ff33836fd7682ebde58f1a606a" name="a4add02ff33836fd7682ebde58f1a606a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4add02ff33836fd7682ebde58f1a606a">&#9670;&#160;</a></span>onUpdateTbl()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::onUpdateTbl </td>
          <td>(</td>
          <td class="paramtype">std::function&lt; void(const std::string &amp;data) &gt;</td>          <td class="paramname"><span class="paramname"><em>fun</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置数据更新处理的回调函数。主要用来更新表格和文件 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">fun[</td><td>I ], 回调函数 函数原型为： void fun( const std::string&amp; data ); 参数data是具体数据内容 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="../../df/ddf/tcp_svr_8hpp_source.html">tcpSvr.hpp</a> 第 <a class="el" href="../../df/ddf/tcp_svr_8hpp_source.html#l00059">59</a> 行定义.</p>

</div>
</div>
<a id="a37a59a25e5b004011b96c96aacb9cce9" name="a37a59a25e5b004011b96c96aacb9cce9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a37a59a25e5b004011b96c96aacb9cce9">&#9670;&#160;</a></span>send()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void tcpSvr::send </td>
          <td>(</td>
          <td class="paramtype">const char *</td>          <td class="paramname"><span class="paramname"><em>data</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t</td>          <td class="paramname"><span class="paramname"><em>len</em></span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>实现了 <a class="el" href="../../de/d17/structdc_itfc.html#a8d3e5af287ee032d94c3206b777762f3">dcItfc</a>.</p>

<p class="definition">在文件 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a> 第 <a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html#l00197">197</a> 行定义.</p>

</div>
</div>
<a id="a52861dbf4db48f2dfc7a88c31d18aef8" name="a52861dbf4db48f2dfc7a88c31d18aef8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a52861dbf4db48f2dfc7a88c31d18aef8">&#9670;&#160;</a></span>type()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual const std::string tcpSvr::type </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>实现了 <a class="el" href="../../de/d17/structdc_itfc.html#aab0fbc14cc9a4bc6f503c02e3130da6a">dcItfc</a>.</p>

<p class="definition">在文件 <a class="el" href="../../df/ddf/tcp_svr_8hpp_source.html">tcpSvr.hpp</a> 第 <a class="el" href="../../df/ddf/tcp_svr_8hpp_source.html#l00074">74</a> 行定义.</p>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>include/<a class="el" href="../../df/ddf/tcp_svr_8hpp_source.html">tcpSvr.hpp</a></li>
<li>src/<a class="el" href="../../dc/d4c/tcp_svr_8cpp_source.html">tcpSvr.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
